<template>
    <Nav />
    <Menu />
    <el-row>
      <el-col :span="30">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          :router="true"
        >
        <el-menu-item index="/newsfabu">
          <el-icon><document /></el-icon>
          <span>新闻发布</span>
        </el-menu-item>
        <el-sub-menu index="/adminnews">
            <template #title>
                <el-icon><document /></el-icon>新闻管理</template>
            <el-menu-item index="/adminnews">新闻动态</el-menu-item>
            <el-menu-item index="/adminevent">活动预告</el-menu-item>
            <el-menu-item index="/adminacad">学术交流</el-menu-item>
            <el-menu-item index="/adminnotice">工作通知</el-menu-item>
        </el-sub-menu>
        </el-menu>
      </el-col>
      <router-view></router-view> <!-- 在这里添加 -->
    </el-row>
  </template>
  
<script setup lang="ts">
import Nav from "../components/navBar.vue";
import Menu from "../components/menu.vue";
import Swiper from "../components/swiper.vue";
import Fonction from "../components/fonction.vue";
import Footer from "../components/footer.vue";
import Title from "../components/title.vue";

import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
  } from '@element-plus/icons-vue'
  const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
  const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
  </script>

<style>
.el-row {
    align-self: flex-start; /* 或者使用 "self-start" */
    margin: 0; /* 移除任何可能的自动margin */
    margin-left: 200px; /* 或者你想要的任何值 */
}
</style>